﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="AddSubCategory.aspx.cs" Inherits="Admin_Default2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="top-bar select-bar">
        <h1>
            <b>Sub Category</b></h1>
        <asp:Label ID="lblmsg" Font-Bold="true" Width="100%" runat="server" BackColor="GreenYellow"
            ForeColor="Black" EnableTheming="False"></asp:Label>
    </div>
    <br />
    <div>
        <table>
            <tr>
                <td>
                    <asp:Label ID="lblSelectCategory" Font-Bold="true" runat="server" Text="Select Category: "></asp:Label>
                </td>
                <td>
                    <asp:DropDownList ID="ddlCategory" runat="server" Width="150%" AutoPostBack="True"
                        OnSelectedIndexChanged="ddlCategory_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblSubCategory" Font-Bold="true" runat="server" Text="Add Sub Category: "></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtSubCategory" runat="server" Width="150%"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td align="center">
                    <asp:Button ID="btnAddSubCategory" Font-Bold="true" Text="Add" runat="server" OnClick="btnAddSubCategory_Click" />
                </td>
            </tr>
        </table>
    </div>
    <div>
        <asp:GridView ID="grdSubCategory" Width="100%" GridLines="Horizontal" runat="server" DataKeyNames="SubCategoryID"
            AutoGenerateColumns="false" ShowHeader="true" OnRowCancelingEdit="grdSubCategory_RowCancelingEdit"
            OnRowEditing="grdSubCategory_RowEditing" OnRowUpdating="grdSubCategory_RowUpdating">
            <Columns>
                <asp:TemplateField HeaderText="ID">
                    <ItemTemplate>
                        <asp:Label ID="lblSubCategoryID" Font-Bold="true" Text='<%# DataBinder.Eval(Container.DataItem,"SubCategoryID")%>'
                            runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Category Name">
                    <ItemTemplate>
                        <asp:Label ID="lblCategoryName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"CategoryName")%>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:Label ID="lblCategoryId" Visible="false" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"CategoryId")%>'></asp:Label>
                        <asp:DropDownList ID="ddlCategoryName" runat="server" Width="95%">
                        </asp:DropDownList>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Sub Category Name">
                    <ItemTemplate>
                        <asp:Label ID="lblSubCategoryName" Font-Bold="true" Text='<%# DataBinder.Eval(Container.DataItem,"SubCategoryName")%>'
                            runat="server"></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtSubCategoryName" Width="200px" BackColor="White" BorderStyle="Dotted"
                            BorderColor="Blue" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"SubCategoryName")%>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:CommandField ShowEditButton="True" EditImageUrl="~/Admin/img/edit-icon.gif" UpdateImageUrl="~/Admin/img/save-icon.gif" CancelImageUrl="~/Admin/img/hr.gif" ButtonType="Image" />
            </Columns>
            <AlternatingRowStyle BackColor="ButtonShadow" />
            <HeaderStyle BackColor="SpringGreen" />
        </asp:GridView>
    </div>
</asp:Content>

